package com.linck.im.client.handler;

import com.linck.im.model.proto.ProtoMsg;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * 聊天消息处理器
 *
 * @author: linck
 * @create: 2021-01-26
 */
@Slf4j
public class ClientMessageHandler extends SimpleChannelInboundHandler<ProtoMsg.Message> {
    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, ProtoMsg.Message message) throws Exception {
        // 收到聊天消息，直接显示
        log.info("收到聊天消息：\t{}:{} ", message.getFrom(), message.getContent());
    }
}
